﻿using System;
using System.Collections.Generic;
using System.Text;
using Torch.WL.Business.Interface;
using Torch.FrameWork.Utility;

namespace Torch.WL.Business
{
    public abstract class BaseProvider<T>
    {
        public string jsonInfo;
        public VerifyInfo<T> postdata;
        public IMessageInfo message;

        public BaseProvider(string _jsonInfo)
        {
            jsonInfo = _jsonInfo;

            ConvertPostData();
            message = new MessageInfo();
            message.code = (int)MessageCodeType.Success;
            message.message = Utils.GetEnumDescription(MessageCodeType.Success);
        }

        public void ConvertPostData()
        {

            try
            {
                postdata = JsonHelper.FromJson<VerifyInfo<T>>(jsonInfo);
            }
            catch (Exception ex)
            {
                throw ex;               
            }
        }
        
    }
}
